import java.awt.Color;
import java.awt.Graphics;


public class Road extends Building{
	private Point p1;
	private Point p2;
	private Player owner;
	
	public Road(Point p1, Point p2, Player owner) {
		super();
		this.p1 = p1;
		this.p2 = p2;
		this.owner = owner;
	}

	public void setP1(Point p1) {
		this.p1 = p1;
	}
	public Point getP1() {
		return p1;
	}
	public void setP2(Point p2) {
		this.p2 = p2;
	}
	public Point getP2() {
		return p2;
	}
	public void setOwner(Player owner) {
		this.owner = owner;
	}
	public Player getOwner() {
		return owner;
	}

	@Override
	protected boolean construct(Player player) {
		// 
		return false;
	}

	@Override
	protected void drawSelf(Graphics g) {
		g.setColor(owner.getColor());
		g.drawLine(p1.getPointDisplay().getCircleX(50) + 25, p1.getPointDisplay().getCircleY(50) + 25, 
					p2.getPointDisplay().getCircleX(50) + 25, p2.getPointDisplay().getCircleY(50) + 25);
		g.drawLine(p1.getPointDisplay().getCircleX(50) + 26, p1.getPointDisplay().getCircleY(50) + 26, 
				p2.getPointDisplay().getCircleX(50) + 26, p2.getPointDisplay().getCircleY(50) + 26);
		g.drawLine(p1.getPointDisplay().getCircleX(50) + 24, p1.getPointDisplay().getCircleY(50) + 24, 
				p2.getPointDisplay().getCircleX(50) + 24, p2.getPointDisplay().getCircleY(50) + 24);
				
	}

	public boolean isConnectedTo(Road r) {
		// TODO Auto-generated method stub
		if (p1.equals(r.getP1()) || p1.equals(r.getP2()) || p2.equals(r.getP1()) || p2.equals(r.getP2()))
			return true;
		return false;
	}
}
